#include <iostream>
#include <thread>
#include <chrono>
#include <boost/lockfree/queue.hpp>

#include <memory>

struct Msg{
    char* session_name = nullptr;
    size_t session_name_len = 0;

    char* data = nullptr;
    size_t data_len = 0;

    void alloc_data(const std::string& name, const std::string& data_str){
        this->session_name = (char*) malloc(name.size());
        memcpy(this->session_name,name.data(),name.size());
        this->session_name_len = name.size();

        this->data = (char*) malloc(data_str.size());
        memcpy(this->data,data_str.data(),data_str.size());
        this->data_len = data_str.size();
    }

    void free_data(){
        if(session_name != nullptr){
            free(session_name);
            session_name = nullptr;
        }
        if(data != nullptr){
            free(data);
            data = nullptr;
        }
    }
};

int main() {
    boost::lockfree::queue<Msg> queue(0);
    return 0;
}
